<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="../../include/laypublic.jsp" %>
<%@ include file="../../include/vueComponent.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <title>资格预审详情</title>
</head>
<link rel="stylesheet" href="${ctx}/resources/vue-element-lib/detail.css">
<body>
<div id="app">
    <div class="layui-tab layui-tab-brief" lay-filter="xqxx-tab-all">
        <ul class="layui-tab-title">
            <li id="tbglId"
                class="layui-this" lay-id="0">资格预审详情
            </li>
            <li id="zgysId" lay-id="1">历史审批信息</li>
        </ul>
        <div class="layui-tab-content" style="height: 100px;">
            <div class="layui-tab-item layui-show">
                <div class="container">
                    <el-form ref="formRef" label-width="180px" label-suffix="："
                             label-position="left">
                        <%--项目基础信息--%>
                        <div class="base-info">
                            <div class="title">
                                <h3>项目基础信息</h3>
                            </div>
                            <!--表单-->
                            <el-row>
                                <x-col>
                                    <el-form-item label="项目名称">
                                        <span>{{info.proName}}</span>
                                    </el-form-item>
                                </x-col>
                                <x-col position="right">
                                    <el-form-item label="项目类型">
                                        <span>{{info.proTypes}}</span>
                                    </el-form-item>
                                </x-col>

                            </el-row>
                            <el-row>
                                <x-col>
                                    <el-form-item label="项目编码">
                                        <span>{{info.proCode}}</span>
                                    </el-form-item>
                                </x-col>
                                <x-col position="right">
                                    <el-form-item label="项目业态">
                                        <span>{{info.proFormat}}</span>
                                    </el-form-item>
                                </x-col>
                            </el-row>
                            <el-row>
                                <x-col>
                                    <el-form-item label="所属公司">
                                        <span>{{info.compName}}</span>
                                    </el-form-item>
                                </x-col>
                                <x-col position="right">
                                    <el-form-item label="申请部门">
                                        <span>{{info.deptName}}</span>
                                    </el-form-item>
                                </x-col>

                            </el-row>
                            <el-row>
                                <x-col>
                                    <el-form-item label="资质类型">
                                        <x-select v-model="info.qualificationType" :options="inquiryTypes" disabled
                                                  name="资质类型"></x-select>
                                    </el-form-item>
                                </x-col>
                                <x-col position="right">
                                    <el-form-item label="营销经理">
                                        <span>{{info.staffName}}</span>
                                    </el-form-item>
                                </x-col>
                            </el-row>
                        </div>
                        <%--项目合作方--%>
                        <div class="title">
                            <h3>预审投标信息</h3>
                        </div>
                        <el-row>
                            <x-col>
                                <el-form-item label="报名截止日期">
                                    <el-date-picker style="width: 100%" v-model="info.signupEndDate" type="date" disabled
                                                    placeholder="报名截止日期"></el-date-picker>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="资格预审截止日期">
                                    <el-date-picker style="width: 100%" v-model="info.bidEndDate" type="date" disabled
                                                    placeholder="资格预审截止日期"></el-date-picker>
                                </el-form-item>
                            </x-col>

                        </el-row>
                        <el-row>
                            <x-col>
                                <el-form-item label="是否需要保证金">
                                    <x-select v-model="info.isNeedBond" :options="yesOrNo" disabled name="是否需要保证金"></x-select>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="保证金方式">
                                    <x-select v-model="info.marginMethod" :options="bidBondMode" disabled
                                              name="保证金方式"></x-select>
                                </el-form-item>
                            </x-col>

                        </el-row>
                        <el-row>
                            <x-col>
                                <el-form-item label="投标保证金(万元)">
                                    <x-input v-model="info.bondMoney" name="投标保证金" disabled/>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="投标保证金截止日">
                                    <el-date-picker style="width: 100%" v-model="info.bondEndDate" type="date" disabled
                                                    placeholder="投标保证金截止日"></el-date-picker>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <el-row>
                            <x-col>
                                <el-form-item label="报名牵头单位">
                                    <x-input v-model="info.signupLead" name="报名牵头单位" disabled/>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="是否需要外部联合体单位">
                                    <x-select v-model="info.isNeedUnit" :options="yesOrNo" disabled
                                              name="是否需要外部联合体单位"></x-select>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <el-row>
                            <x-col>
                                <el-form-item label="联合体成员">
                                    <x-input v-model="info.unit" name="联合体成员" disabled/>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="是否通过资审" disabled>
                                    <x-select v-model="info.isThrough" :options="yesOrNo" name="是否通过资审" disabled></x-select>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <el-row>
                            <x-col>
                                <el-form-item label="预计回收时间">
                                    <el-date-picker style="width: 100%" v-model="info.recoveryTime" type="date" disabled
                                                    placeholder="预计回收时间"></el-date-picker>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <div class="title">
                            <h3>支付申请信息</h3>
                        </div>
                        <el-row>
                            <x-col>
                                <el-form-item label="支付单位">
                                    <x-input v-model="info.accountName" name="支付单位" disabled/>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="银行账号">
                                    <x-input v-model="info.accountNo" name="银行账号" disabled/>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <el-row>
                            <x-col>
                                <el-form-item label="支付开户行">
                                    <x-input v-model="info.openBankName" name="支付开户行" disabled/>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <div class="title">
                            <h3>项目附件信息</h3>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width:350px;">支持pdf、excel、word、图片资料，可上传多个</label>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">资审招标文件（选填）</label>
                            <div class="layui-input-block">
                                <div class="layui-upload">

                                    <div class="layui-upload-list" id="10-upload-more-list">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">项目实施方案（选填）</label>
                            <div class="layui-input-block">
                                <div class="layui-upload">

                                    <div class="layui-upload-list" id="11-upload-more-list">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">资质公告</label>
                            <div class="layui-input-block">
                                <div class="layui-upload">
                                    <div class="layui-upload-list" id="12-upload-more-list">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">政府公示截图</label>
                            <div class="layui-input-block">
                                <div class="layui-upload">
                                    <div class="layui-upload-list" id="13-upload-more-list">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </el-form>
                </div>
            </div>
            <div class="layui-tab-item">
                <%@ include file="lay-processHistory-detail.jsp" %>
            </div>
        </div>
    </div>
</div>
</div>
<script src="${ctx}/resources/vue-element-lib/jquery.js"></script>
<script>
    let fileArr = []
    var staticPath = '${fileHttpPre}';
    layui.config({
        base: '${ctx}/resources/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'set', 'upload', 'table', 'transfer', 'laydate', 'element', 'layer'], function () {
        var $ = layui.$
            , upload = layui.upload
            , table = layui.table
            , element = layui.element
            , layer = layui.layer;

        if ("${auditTabFlag}" === "1") {
            if ("${isAuditFlag}" === "1") {
                vm.$data.layId = 2;
            }
        }

    });

    //删除文件
    function del(index) {
        layui.$("#fileAtt_" + index).remove();
        layui.$("#upload_img_" + index).remove();
        fileArr.map((el, idx) => {
            if (el.split('|')[2] == index) {
                fileArr.splice(idx, 1)
            }
        })
    }

    //根据url查看文件
    function showImg(url) {
        var openWin = window.open(url, '', 'left=410,height=768, width=1024, top=200,  toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');
    }

    /*核心*/
    var vm = new Vue({
        el: '#app',
        data() {
            return {
                layId: '0',
                procNodeList: [],
                tempNodeList: [],
                auditMsg: '',//审批意见
                info: {},
                yesOrNo: [],
                inquiryTypes: [],
                bidBondMode: [],
            }
        },
        created() {
            let that = this;
            that.id = "${id}";
            that.processId = "${processId}";
            that.queryProcessList();
        },
        mounted() {

        },
        methods: {
            queryProcessList() {
                let that = this;
                $.ajax({
                    type: 'post',
                    url: basePath + '/historyProcess/proNodeDetail',  //请求数据接口
                    data: {processId: that.processId},
                    success: function (result) {
                        if (result.entity) {
                            that.procNodeList = result.entity.procNodeList;
                            that.tempNodeList = result.entity.tempNodeList;
                            that.info = result.entity.detailJson.info;
                            that.yesOrNo = result.entity.detailJson.yesOrNo;
                            that.inquiryTypes = result.entity.detailJson.inquiryTypes;
                            that.bidBondMode = result.entity.detailJson.bidBondMode;
                            if (fileArr.length == 0) {
                                that.showFile(result.entity.detailJson.fileAtt);
                            }
                        }
                    }
                });
            },
            //展示文件
            showFile(fileList) {
                if (fileList && fileList.length > 0) {
                    fileArr = fileList;
                    for (let i in fileList) {
                        let contractInfo = fileList[i];
                        let arr = contractInfo.split("|");
                        let imgSrc = "";
                        let suffix = arr[1].substring(arr[1].lastIndexOf(".") + 1, arr[1].length);
                        if (suffix == 'jpg' || suffix == 'png') {
                            imgSrc = "${fileHttpPre}/" + arr[3];
                        } else {
                            imgSrc = "${ctx}/resources/images/" + suffix + ".jpg";
                        }
                        $('#' + arr[0] + '-upload-more-list')
                            .append('<div class="layui-upload-img-div" id="upload_img_' + arr[2] + '"><img src="' + imgSrc + '" title="'
                                + arr[1] + '" class="layui-upload-img"><div class="mask"><a href="javascript:void(0)" onclick="showImg(\'' + "${fileHttpPre}"
                                + arr[3] + '\');">查看</a><a href="javascript:void(0)" onclick="del(\''
                                + arr[2] + '\')";>删除</a></div><p>' + arr[1] + '</p><input type="hidden" value="'
                                + contractInfo + '" id="fileAtt_' + arr[2] + '" name="fileAtts" ></input></div> ');
                    }
                }
            },
        }
    })
</script>
</body>
</html>

